package com.b511.swpu.cementbackend.repository;

import com.b511.swpu.cementbackend.entity.Sys_User_Roles;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface Sys_User_RolesRepository extends JpaRepository<Sys_User_Roles, String>, JpaSpecificationExecutor<Sys_User_Roles> {
    @Query(value = "select roles_id from sys_user_roles where sys_user_id=:id",nativeQuery = true)
    String findRoleID(@Param("id") String id);

    @Query(value = "select * from sys_user_roles where roles_id=:id",nativeQuery = true)
    List<Sys_User_Roles> findByRoleID(@Param("id") String id);
}
